import request from "@/utils/request.js";
const login = {
  register: (data) =>
    request.post({
      url: "/app/user/register",
      data: data,
    }),
  login: (data) =>
    request.post({
      url: "/app/user/login",
      data: data,
    }),
  getCode: (data) =>
    request.get({
      url: "/app/user/code",
    }),
	resetPassNew: (data) =>
	  request.post({
	    url: "/app/user/changePasswordNew",
		data: data,
	  }),
};

const api = {
  // 查询公示公告分页列表
  getAnnouncementPage: (data) =>
    request.post({
      url: "/app/home/getAnnouncementPage",
      data: data,
    }),
  getDemandProjectPage: (data) =>
    request.post({
      url: "/app/home/getDemandProjectPage",
      data: data,
    }),
  getSupplyProjectPage: (data) =>
    request.post({
      url: "/app/home/getSupplyProjectPage",
      data: data,
    }),
  getAreaList: (data) =>
    request.get({
      url: "/app/home/getAreaList?pid=" + data.pid,
    }),
  upload: (param) => request.upload(param),
  // 修改密码
  changePassword: (data) =>
    request.post({
      url: "/app/user/changePassword",
      data: data,
    }),
  sendFeedBack: (data) =>
    request.post({
      url: "/app/user/sendFeedBack",
      data: data,
    }),
  // 产权合同
  getContract: (data) =>
    request.get({
      url: "/app/enroll/getContract",
      data: data,
    }),
  // 承诺函
  getPromise: (data) =>
    request.get({
      url: "/app/enroll/getPromise",
      data: data,
    }),
  // 报名须知
  getInstruction: (data) =>
    request.get({
      url: "/app/enroll/getInstruction",
      data: data,
    }),
};
// 电子竞价
const electBidding = {
  //报名项目列表
  getSupplyProject: (data) =>
    request.post({
      url: "/app/enroll/getSupplyProject",
      data: data,
    }),
  //竞价项目列表
  getBiddingSupplyProject: (data) =>
    request.post({
      url: "/app/enroll/getBiddingSupplyProject",
      data: data,
    }),
  //结束项目列表
  getFinishSupplyProject: (data) =>
    request.post({
      url: "/app/enroll/getFinishSupplyProject",
      data: data,
    }),
  //审核人列表
  getUserList: (data) =>
    request.get({
      url: "/app/enroll/getUserList",
      data: data,
    }),
  //我要报名
  projectReport: (data) =>
    request.post({
      url: "/app/projectUserInfo/projectUserReport",
      data: data,
    }),
	//修改 我要报名
	projectReportAgain: (data) =>
	  request.post({
	    url: "/app/projectUserInfo/projectUserReportAgain",
	    data: data,
	  }),
  //我要签到
  projectSign: (data) =>
    request.post({
      url: "/app/projectUserInfo/projectSign",
      data: data,
    }),
  //获取项目当前用户最高价最低价
  getBiddingPrice: (data) =>
    request.get({
      url: "/app/enroll/getBiddingPrice",
      data: data,
    }),
  //获取项目当前给出的最高价最低价
  getProjectMaxBidPrice: (data) =>
    request.get({
      url: "/app/projectUserInfo/getProjectMaxBidPrice",
      data: data,
    }),
	//获取项目延时后的时间
	getProjectBiddingEndTime: (data) =>
	  request.get({
	    url: "/app/projectUserInfo/getProjectBiddingEndTime",
	    data: data,
	  }),
	  //获取提交价格时的临界值
	  getBiddingPriceGap: (data) =>
	    request.get({
	      url: "/app/projectUserInfo/getProjectBiddingPriceGap",
	      data: data,
	    }),
  //我要竞价
  projectBid: (data) =>
    request.post({
      url: "/app/projectUserInfo/projectBid",
      data: data,
    }),
	//获取个人报名信息
	getPersonalApplyInfo: (data) =>
	  request.get({
	    url: "/app/enroll/getProjectUserInfoDetail",
	    data: data,
	  }),
	
};
const demandProject = {
  getPage: (data) =>
    request.post({
      url: "/app/demandProject/getPage",
      data: data,
    }),
  getDetail: (data) =>
    request.get({
      url: "/app/demandProject/getDetail",
      data: data,
    }),
};
const supplyProject = {
  getDetail: (data) =>
    request.get({
      url: "/app/enroll/getSupplyProjectDetail",
      data: data,
    }),
};
//招标公示
const callForTender = {
  //招标公示
  getPage: (data) =>
    request.post({
      url: "/app/announcement/callForTender/getPage",
      data: data,
    }),
  getDetail: (data) =>
    request.get({
      url: "/app/announcement/callForTender/getDetail",
      data: data,
    }),
};
//中标公示
const bid = {
  getPage: (data) =>
    request.post({
      url: "/app/announcement/bid/getPage",
      data: data,
    }),
  getDetail: (data) =>
    request.get({
      url: "/app/announcement/bid/getDetail",
      data: data,
    }),
};
//成交公示
const projectDonePublic = {
  getPage: (data) =>
    request.post({
      url: "/app/announcement/projectDonePublic/getPage",
      data: data,
    }),
  getDetail: (data) =>
    request.get({
      url: "/app/announcement/projectDonePublic/getDetail",
      data: data,
    }),
  getDetail1: (data) =>
    request.get({
      url: "/app/enroll/getProjectDonePublicDetail",
      data: data,
    }),
};
//资讯管理
const news = {
  getPage: (data) =>
    request.post({
      url: "/app/news/getPage",
      data: data,
    }),
  getDetail: (data) =>
    request.get({
      url: "/app/news/getDetail",
      data: data,
    }),
  // 获取资讯类别列表
  getNewsTypes: (data) =>
    request.get({
      url: "/app/news/getNewsTypes",
      data: data,
    }),
  //获取1级资讯类别列表
  getLevelOneNewsTypes: (data) =>
    request.get({
      url: "/app/news/getLevelOneNewsTypes",
      data: data,
    }),
  //获取1级资讯类别列表
  getLevelTwoNewsTypes: (data) =>
    request.get({
      url: "/app/news/getLevelTwoNewsTypes",
      data: data,
    }),
};
const mineProject = {
  // 报名项目
  getGrEnrollSupplyProject: (data) =>
    request.post({
      url: "/app/enroll/getGrEnrollSupplyProject",
      data: data,
    }),
  // 竞价项目
  getGrBiddingSupplyProject: (data) =>
    request.post({
      url: "/app/enroll/getGrBiddingSupplyProject",
      data: data,
    }),
  // 中标项目
  getGrWinSupplyProject: (data) =>
    request.post({
      url: "/app/enroll/getGrWinSupplyProject",
      data: data,
    }),
  // 报名项目详情
  getProjectUserInfoDetail: (data) =>
    request.get({
      url: "/app/enroll/getProjectUserInfoDetail",
      data: data,
    }),
};
export {
  login,
  api,
  electBidding,
  demandProject,
  supplyProject,
  callForTender,
  bid,
  news,
  projectDonePublic,
  mineProject,
};
